package com.chenyuxin.ilp.service.user.Impl;

import cn.hutool.core.bean.BeanUtil;
import com.chenyuxin.ilp.mapper.user.UserStorageMapper;
import com.chenyuxin.ilp.model.entity.user.UserStorage;
import com.chenyuxin.ilp.model.pojo.Result;
import com.chenyuxin.ilp.model.vo.user.UserStorageVo;
import com.chenyuxin.ilp.service.user.UserStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserStorageServiceImpl implements UserStorageService {
    @Autowired
    private UserStorageMapper userStorageMapper;
    // 获取用户存储
    @Override
    public Result getUserStorage(String userId) {
        UserStorage userStorage = userStorageMapper.selectById(userId);
        UserStorageVo userStorageVo = BeanUtil.copyProperties(userStorage, UserStorageVo.class);
        return Result.ok(userStorageVo);
    }
}
